package cn.doitedu.datayi.demos;

import ch.hsr.geohash.GeoHash;

public class GeoHashCodeDemo {

    public static void main(String[] args) {

        double lat1 = 23.077600448604418;
        double lng1 = 113.24885309483015;

        double lat2 = 23.127160882740114;
        double lng2 = 113.24842385211862;


        // 把经纬度编成geohash码
        String s1 = GeoHash.geoHashStringWithCharacterPrecision(lat1, lng1, 8);
        String s2 = GeoHash.geoHashStringWithCharacterPrecision(lat2, lng2, 8);

        System.out.println(s1);
        System.out.println(s2);

    }

}
